#include "Globals.h"
#include "iproperty.h"

//--------------------------------------------------------------------------------
//	initialize a text asset
//--------------------------------------------------------------------------------
void *IProperty::AssetInit( IAssetFile *pi, const CMasterIndexEntry *pme, void *context )
{
	IProperty	*ret;

	ret = (IProperty*)pi->GetChunk(pme->nameHash,pme->primaryChunk);
	if( ret )
	{
		pi->SetupHashList(&ret->intValues,ret,false);
		pi->SetupHashList(&ret->floatValues,ret,false);
		pi->SetupHashList(&ret->vectorValues,ret,false);
		pi->SetupHashList(&ret->charValues,ret);
	}
	return (void*)ret;
}

//--------------------------------------------------------------------------------
//	uninitialize a text asset
//--------------------------------------------------------------------------------
void IProperty::AssetUninit( void *ptr, void *context )
{
}

//--------------------------------------------------------------------------------
//	fixup an asset
//--------------------------------------------------------------------------------
void IProperty::AssetFixup( CAssetFileMgr *pMgr, const IAssetFile *pFile, void *ptr, const CMasterIndexEntry *pEntry )
{
	IProperty *pProp = (IProperty*)ptr;
	if( pProp->parentName )
		pProp->parent = (SPropertyData*)pMgr->FindAsset(pProp->parentName,"PROPERTY");
}
